package com.ruoyi.mp.controller;

import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.db.domain.system.MpClient;
import com.ruoyi.db.domain.web.MpIncomeRecord;
import com.ruoyi.mp.annotion.Login;
import com.ruoyi.mp.annotion.LoginUser;
import com.ruoyi.mp.service.IMpIncomeRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 【请填写功能名称】Controller
 * 
 * @author ruoyi
 * @date 2022-07-26
 */
@Api(value = "【收支明细】",tags ="【收支明细】")
@RestController
@RequestMapping("/smp/income/record")
public class MpIncomeRecordController extends BaseController
{
    private static Logger log = LoggerFactory.getLogger(MpIncomeRecordController.class);
    @Autowired
    private IMpIncomeRecordService mpIncomeRecordService;

    /**
     * 查询【请填写功能名称】列表
     */
    @Login
    @ApiOperation(value = "查询【请填写功能名称】列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name="mpIncomeRecord",value="【请填写功能名称】",paramType="form")
    })
    @GetMapping("/list")
    public TableDataInfo list(MpIncomeRecord mpIncomeRecord, @LoginUser MpClient client)
    {
        try {
            startPage();
            mpIncomeRecord.setClientId(client.getClientId());
            List<MpIncomeRecord> list = mpIncomeRecordService.selectMpIncomeRecordList(mpIncomeRecord);
            return getDataTable(list);
        }catch (Exception e){
            log.error("【请填写功能名称】发生异常",e);
        }
        return null;
    }


}
